import router from '@/router';
<template>
  <div class="common-layout">
    <el-container>
      <el-header class="header" height="40px">
        <div class="left_log">
          <el-icon><HomeFilled /></el-icon>
          学生外卖系统
        </div>
        <div style="margin-right: 40px">
          <el-button type="primary" @click="GoLogin">登录</el-button>
          <el-button type="warning" @click="GoRegister">注册</el-button>
        </div>
      </el-header>
      <el-main class="main">
        <el-carousel indicator-position="outside" class="box" height="500px">
          <el-carousel-item v-for="item in foodList" :key="item" class="box_item">
            <el-image style="width: 100%" :src="item" fit="cover" />
          </el-carousel-item>
        </el-carousel>
      </el-main>
      <el-footer>
        <el-card style="width: 100%">
          <template #header>
            <div class="card-header">
              <span>外卖系统</span>
            </div>
          </template>
          <p>
            外卖服务为消费者提供了便利，他们可以通过几次点击在手机应用程序上或网页上点餐，并等待食物送达到他们所在的位置
          </p>
          <p>
            外卖服务通常提供各种类型的餐厅选择，包括中餐、西餐、快餐、素食等，以满足不同人的口味偏好。
          </p>
          <p>
            外卖服务通常提供送货服务，消费者可以选择送货到家或办公室，从而避免外出就餐的麻烦。
          </p>
          <p>
            许多外卖服务提供实时跟踪功能，消费者可以实时查看他们的订单在送货过程中的位置和预计送达时间。
          </p>
          <p>
            外卖服务通常支持多种支付选项，包括信用卡、支付宝、微信支付等，为消费者提供方便的支付方式。
          </p>
          <template #footer>让你的生活更加便利</template>
        </el-card>
      </el-footer>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import router from "@/router";

const foodList = [
  "https://static.xinshipu.com/20161207/original/1481102525979.jpg@420w_170h_90q_1e_1c.jpg",
  "https://static.xinshipu.com/20170824/original/1503587735910.jpg@196w_126h_99q_1e_1c.jpg",
  "https://static.xinshipu.com/20130531/original/1369956215954.jpg@196w_126h_99q_1e_1c.jpg",
  "https://static.xinshipu.com/20110618/original/1308363411443.jpg@196w_126h_99q_1e_1c.jpg",
];

const GoLogin = () => {
  router.push("/auth/login");
};

const GoRegister = () => {
  router.push("/auth/register");
};
</script>

<style lang="scss" scoped>
.header {
  .left_log {
    display: flex;
    color: #d4e4af;
    margin-left: 40px;
    background-color: #4b4b4b;
    height: 30px;
    width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
  }
  align-items: center;
  width: 100%;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
}
.main {
  display: flex;
  height: 500px;
  justify-content: center;
  align-content: center;
  .box {
    width: 60%;
    .box_item {
      display: flex;
      justify-content: center;
      align-content: center;
    }
  }
}
.el-carousel__item h3 {
  display: flex;
  color: #475669;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}
</style>
